package xcmg.syn.service.supplier;


import com.github.pagehelper.PageInfo;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import xcmg.syn.dao.mapper.supplier.MmSupplierMapper;
import xcmg.syn.service.vo.supplier.MmSupplierVO;
import yb.ecp.fast.infra.infra.PageCommonVO;
import yb.ecp.fast.infra.infra.SearchCommonVO;
import yb.ecp.fast.infra.util.PageHelperPlus;

import java.util.List;

/**
 * MmSupplier 后台接口实现类
 */
@Slf4j
@Service
public class MmSupplierService {

    @Autowired
    private MmSupplierMapper mmSupplierMapper;

    public PageCommonVO<MmSupplierVO> list(SearchCommonVO<MmSupplierVO> condition) {
        PageCommonVO<MmSupplierVO> pageCommonVO = new PageCommonVO<>();
        PageHelperPlus.orderBy("SUPPLIER_NO asc");
        PageHelperPlus.startPage(condition.getPageNum(), condition.getPageSize());
        List<MmSupplierVO> doList = mmSupplierMapper.queryList(condition.getFilters());
        pageCommonVO.setPageInfo(new PageInfo<>(doList));
        pageCommonVO.setPageInfoList(doList);
        return pageCommonVO;
    }

}
